def isPrime(w):
    c=2
    if w<=1:
        return False
    while c<=w-1:
        if w%c!=0:
            c+=1
        else:
            return False
    return True

n=int(input())
max=n
min=n
count=0
while True:
    min-=1
    if isPrime(min):
        print(min,end=',')
        count+=1
        if count%10==0:
            break
    max+=1
    if isPrime(max):
        print(max,end=',')
        count+=1
        if count % 10 == 0:
            break
print()
